package com.zhou.project.modules.system.dictionary.controller;

import com.zhou.project.modules.system.dictionary.entity.Dictionary;
import com.zhou.project.modules.system.dictionary.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhouhonggang
 * @version 1.0.0
 * @project spring-boot-project
 * @datetime 2021/9/27 12:48
 * @description: TODO
 */
@RestController
@RequestMapping("dictionary")
public class DictionaryController {

    @Autowired
    private DictionaryService dictionaryService;

    @PostMapping
    public void save(@RequestBody Dictionary entity)
    {
        dictionaryService.save(entity);
    }

    @PostMapping("sbatch")
    public void batch(@RequestBody List<Dictionary> list)
    {
        dictionaryService.saveBatch(list);
    }



}
